<template>
  <div>
    <Header></Header>
    <!-- 路由组件展示 -->
    <router-view></router-view>
    <Footer v-show="$route.meta.showFooter"></Footer>
  </div>
</template>

<script>
import Header from '@/components/Header/index.vue'
import Footer from '@/components/Footer/index.vue'
import { requestCategoryList } from '@/api/index'
export default {
  name: 'App',
  components: { Header, Footer },
  mounted() {
    // 写在App组件里面可以减少请求次数(因为根组件只挂在一次)，也是一种优化
    this.$store.dispatch('homeStore/getCategoryList')
  },
  methods: {
    send() {
      console.log(requestCategoryList())
    },
  },
}
</script>

<style>
</style>